package app.area;

import java.util.ArrayList;
import java.util.List;

public class SuperArea extends AbstractArea {
    private List<IArea> listAreas;
    public SuperArea() {
        listAreas = new ArrayList<IArea>();
        listAreas.add(new Rectangle());
        listAreas.add(new Triangle());
        listAreas.add(new Segment());
    }
    @Override
    public boolean contains(float x, float y, float r) {
        for(IArea area : listAreas) {
            if (area.contains(x, y, r)) {
                return true;
            }
        }
        return false;
    }
}
